﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DatabaseExtension
{
    /// <summary>
    /// Library available Database Connections.
    /// </summary>
    public enum Databases
    {
        None,
        MSSQL,
        SQLCompact,
        MySql,
        SQLite,
        Oracle,
        OleDb
    }
    /// <summary>
    /// Descript which additial db action can be used.
    /// </summary>
    [Flags]
    public enum DbInterfaceActions
    {
        /// <summary>
        /// Do special actions are added to DbInterface.
        /// </summary>
        None = 0,
        /// <summary>
        /// If set, connection will be opened automaticly, else open connection manually or with query execution.
        /// </summary>
        AutoOpen = 1 << 0,
        /// <summary>
        /// If set, the DB Interface will always close connection after executing query.
        /// </summary>
        AutoClose = 1 << 1,
        /// <summary>
        /// If set, check for current class implementation.
        /// </summary>
        CheckDbParameter = 1 << 2,
        /// <summary>
        /// Execute Prepare Method before executing DbCommand.
        /// </summary>
        UsePrepare = 1 << 3,
        /// <summary>
        /// if set, Reset internal parameter List else keep parameter for the next query.
        /// </summary>
        ResetParameters = 1 << 4,
        /// <summary>
        /// Enable all additional actions for DbInterface.
        /// </summary>
        Default = 31
    }


    /// <summary>
    /// Define Sql Operation to executed
    /// </summary>
    public enum SqlOperation
    {
        /// <summary>
        /// None... will raise an exception
        /// </summary>
        None = 0,

        /// <summary>
        /// Execute NonQuery Operation, usefull for Update/Delete/Insert
        /// </summary>
        ExecuteNonQuery = 1,

        /// <summary>
        /// Get from first Row and Column data.
        /// </summary>
        ExecuteScalar = 2,

        /// <summary>
        /// Use DataSet
        /// </summary>
        DataAdapter = 3,

        /// <summary>
        /// Use Execute Reader to read all data 
        /// </summary>
        ExecuteReader = 4
    }
}
